package com.gambi.tapestry.services;

import org.apache.tapestry5.ioc.Configuration;
import org.apache.tapestry5.ioc.MappedConfiguration;
import org.apache.tapestry5.services.LibraryMapping;

/**
 * This module is automatically included as part of the Tapestry IoC Registry,
 * it's a good place to configure and extend Tapestry, or to place your own
 * service definitions.
 */
public class TapGWTModule {

	/*
	 * Register this Library in the gwt Virtual Folder
	 */
	public static void contributeComponentClassResolver(
			Configuration<LibraryMapping> configuration) {
		configuration.add(
				new LibraryMapping("gwt",
				"com.gambi.tapestry"));
	}

	/*
	 * Workaround to force the browser to download new version of the assets.
	 * TODO In the next future also core js library if any
	 */
	public static void contributeClasspathAssetAliasManager(
			MappedConfiguration<String, String> configuration) {
		configuration.add("tapestrygwtlib-1.0", "com/example/gambi/tapestry");
	}
}
